<template>
  <div class="w">
    <div class="btitle">为你找到 {{ signalsRadio1.total }} 家竞争对手</div>
    <div
      class="pd20"
      style="padding-bottom: 69px"
      v-loading="signalsRadio1.daochuloading"
      element-loading-text="加载中..."
    >
      <div
        v-if="signalsRadio1.T_dsLiss.length > 0"
        class="vendor"
        v-for="item in signalsRadio1.T_dsLiss"
      >
        <div>
          <img width="60px" src="../../../../assets/newimg/gys.png" alt="" />
          <!-- <img width="60px" src="@/assets/img/gys.png" alt="" /> -->
        </div>
        <div style="flex: 1; margin-left: 10px">
          <div class="vendor_cen">
            <!-- v-html="" -->
            <div class="vendor_h" @click="gysClick(item.key)">
              {{ item.key }}
            </div>
            <div>
              <span class="behalf">
                <!-- {{
                                item.companyOrgType.split("\t")[0]
                            }} -->
              </span>
            </div>
          </div>
          <div class="omission">
            <el-row :gutter="20">
              <el-col :span="3">
                <div class="grays">
                  中标 <span class="graysColor">{{ item.zb_num.value }}次</span>
                </div>
              </el-col>
              <el-col :span="5">
                <div class="grays">
                  中标总金额
                  <span class="graysColor">{{ money(item.jg_sum.value) }}</span>
                </div>
              </el-col>
              <el-col :span="4">
                <div class="grays">
                  最近中标
                  <span class="graysColor">{{
                    timestamp(item.max_time.value)
                  }}</span>
                </div>
              </el-col>
              <el-col :span="5">
                <div class="grays">
                  一起投标次数
                  <span class="graysColor">{{ item.doc_count }} 次</span>
                </div>
              </el-col>
              <el-col :span="4">
                <div class="grays">
                  客户数
                  <span class="graysColor">{{ item.kehu_num.value }}</span>
                </div>
              </el-col>
            </el-row>
          </div>
        </div>
      </div>
      <el-empty
        v-show="signalsRadio1.T_dsLiss.length == 0"
        description="暂无数据"
      />
    </div>
  </div>
  <Pagination v-if="signalsRadio1.routerPush == 'disposition'" />
</template>

<script setup>
import { timestamp, diqu, moneys, money } from "@/utils/index";
import { useRadio1Store } from "@/pain/search/search";
import { useRouter } from "vue-router";
import { useCounterStore } from "@/pain/login/login";
import Pagination from "../../../search/disposition/conperter/pagin/index.vue";
const useRouters = useCounterStore();
const router = useRouter();
const signalsRadio1 = useRadio1Store();
const gysClick = (data) => {
  if (!localStorage.getItem("token")) {
    return (useRouters.uselogin = true);
  }
  if (signalsRadio1.routerPush == "disposition") {
    const href = router.resolve({
      path: "/disposition",
      query: {
        id: 8,
        name: data.replace(/<[^>]+>/g, ""),
      },
    });
    window.open(href.href, "_blank");
  }
};
const pkdaochu = () => {
  // if (signalsRadio1.routerPush == 'disposition') {
  //     signalsRadio1.getcompetitors()
  // }
  if (signalsRadio1.routerPush == "details") {
    let daochu = JSON.parse(localStorage.getItem("daochu"));
    console.log(daochu);
    let list = {
      ...daochu,
    };
    signalsRadio1.shujugetcompetitors(list);
  }
};
pkdaochu();
</script>

<style lang="scss" scoped>
.w {
  width: 1200px;
  margin: 0 auto;
  background-color: #fff;
}

.pd20 {
  padding: 0 20px;
  min-height: 500px;
}

.btitle {
  display: flex;
  align-items: center;
  height: 50px;
  padding: 0 20px;
  border-bottom: 1px solid #eeeeee;
}

.vendor {
  display: flex;
  padding: 20px 0;
  border-bottom: 1px solid #eeeeee;
}

.vendor_cen {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;

  .vendor_h {
    margin-top: 5px;
    font-size: 16px;
    color: #333333;
  }
}

.omission {
  width: 1090px;
  text-align: left;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 14px;
}
</style>
